//package com.starinside.wp.components;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//import org.springframework.core.env.Environment;
//import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
//import org.springframework.jdbc.core.JdbcTemplate;
//import org.springframework.jdbc.datasource.DriverManagerDataSource;
//import org.springframework.orm.jpa.JpaTransactionManager;
//import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
//import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
//import org.springframework.transaction.PlatformTransactionManager;
//
//import javax.sql.DataSource;
//import java.util.HashMap;
//
///**
// * @Describle This Class Is connect vega datasource
// * @Author ZengMin
// * @Date 2018/11/21 10:53
// * @Company Matt
// */
//@Configuration
//public class DataSourceConfig {
//    @Bean(name = "vegaDataSource")
//    @ConfigurationProperties(prefix = "vega.datasource")
//    public DataSource dataSource(){
//        org.apache.tomcat.jdbc.pool.DataSource dataSource = new org.apache.tomcat.jdbc.pool.DataSource();
//        dataSource.setTestWhileIdle(true);
//        dataSource.setNumTestsPerEvictionRun(3600000);
//        dataSource.setValidationQuery("select 1");
//        return dataSource;
//    }
//
//    @Bean(name = "vegaJdbcTemplate")
//    public JdbcTemplate jdbcTemplate(){
//        return new JdbcTemplate(dataSource());
//    }
//
//}
